#include "testpool.hpp"
#include "Task.hpp"
#include <time.h>
#include <unistd.h>
int main()
{
    threadpool<Task<int>> *tp = new threadpool<Task<int>>(4);
    tp->Start();
    while (true)
    {
        srand(time(nullptr));
        int x = rand() % 20;
        usleep(13);
        int y = rand() % 20;
        Task<int> t(x, 0, Task<int>::GetOpers()[rand() % Task<int>::GetOpers().size()]);
        tp->Push(t);
        std::cout<<"拿到任务..."<<t.GetTask()<<std::endl;
        sleep(1);
    }
    return 0;
}